package com.sansheng.web;

import com.sansheng.service.UserService;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author 陈龙
 * @version 2017年09月10日 20时35分
 */
@RestController
@EnableAutoConfiguration
@RequestMapping(value = "/user", method = RequestMethod.POST)
public class UserController {

    @Autowired
    private UserService userService;

    /**
     * 登录接口，参数自己加再整理
     *
     * @param userName
     * @param password
     * @return
     */
    @RequestMapping("/login")
    public @ResponseBody
    JSONObject login(HttpServletRequest request, String userName, String password) {
        JSONObject json = new JSONObject();
        json.put("userName", userName);
        json.put("password", password);
        return json;
    }
}
